<template>
    <div class="work">
        <el-container>
            <el-header>
                头部
            </el-header>
            <el-container>
                <el-aside width="200px">
                  菜单
                    <el-button @click="getMenu">获取菜单</el-button>
                    <template v-if="menuList">
                        <router-link v-for="item in menuList" :key="item.id" :to="item.path">{{item.menuName}}</router-link>
                    </template>
                </el-aside>
                <el-main>
                    页面
                    <router-view />
                </el-main>
            </el-container>
        </el-container>
    </div>
</template>

<script setup lang="ts">
import http from "@/utils/http";

interface Menu {
    id: string,
    createDate?: Date,
    component: string,
    menuName: string,
    menuNo: string,
    path: string,
    updateDate?: Date,
}

let menuList: Menu[] = []

const getMenu = () => {
    http.get('/menus').then(res => {
        console.log(res)
        menuList = res as Menu[]
    })
}

</script>

<style scoped>
.work{
    width: 100vh;
    height: 100vh;
}
</style>